package com.lhdx.practical.dao;

import com.lhdx.practical.bean.MenuConfig;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface MenuConfigDao extends CrudRepository<MenuConfig,Long> {
    List<MenuConfig> findAllByGradeid(long gradeid);

    List<MenuConfig> findAllByPersonid(long personid);

    List<MenuConfig> findAllByPersonidAndGradeid(long personid,long gradeid);

    MenuConfig findByGradeidAndMenuid(long gradeid,long menuid);

    @Transactional
    void deleteAllByGradeid(long gradeid);
}
